package com.dliu.javadesign.create.builder;

/**
 * @author yanglei
 * date 2021/3/29 17:31
 */
public class MealBuilder {

    /**
     * 蔬菜汉堡+可口可乐
     */
    public Meal doVegMeal(){
        Meal meal = new Meal();
        meal.addItem(new VegBurger());
        meal.addItem(new CokeDrink());
        return meal;
    }

    /**
     * 肌肉汉堡+百事可乐
     */
    public Meal doChickMeal(){
        Meal meal = new Meal();
        meal.addItem(new ChickBurger());
        meal.addItem(new PepsiDrink());
        return meal;
    }

    public static void main(String[] args) {
        MealBuilder mealBuilder = new MealBuilder();
        Meal meal = mealBuilder.doVegMeal();
        meal.showItems();
        meal.getCost();

        System.out.println();
        Meal meal1 = mealBuilder.doChickMeal();
        meal1.showItems();
        meal1.getCost();
    }
}
